﻿<ResourceDictionary
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:DataClasses="clr-namespace:System.Data.Objects.DataClasses;assembly=System.Data.Entity"
      xmlns:Repository="clr-namespace:Repository;assembly=Repository"
      xmlns:Converters="clr-namespace:Dispatcher.Converters" mc:Ignorable="d" >
    
    <Converters:IdFormatConverter x:Key="IdFormatConverter"/>

    <HierarchicalDataTemplate 
            DataType = "{x:Type Repository:PersonGroup}"
            ItemsSource = "{Binding Path=ChildPersonGroup}">
        <Grid>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Id, Converter={StaticResource IdFormatConverter}}"/>
                <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=StartTime}"/>
            </StackPanel>
        </Grid>
    </HierarchicalDataTemplate>

    <HierarchicalDataTemplate 
            DataType = "{x:Type Repository:EventGroup}"
            ItemsSource = "{Binding Path=ChildEventGroup}">
        <Grid>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Id, Converter={StaticResource IdFormatConverter}}"/>
                <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=StartTime}"/>
            </StackPanel>
        </Grid>
    </HierarchicalDataTemplate>

    <DataTemplate DataType = "{x:Type Repository:Person}">
        <Grid AllowDrop="True">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Id, Converter={StaticResource IdFormatConverter}}"/>
                <TextBlock Text="{Binding Path=FirstName}" ToolTip="{Binding Path=FirstName}"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate DataType = "{x:Type Repository:Event}">
        <Grid AllowDrop="True">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Id, Converter={StaticResource IdFormatConverter}}"/>
                <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=StartTime}"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate DataType = "{x:Type DataClasses:EntityObject}">
        <Grid AllowDrop="True">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Id, Converter={StaticResource IdFormatConverter}}"/>
                <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=Description}"/>
            </StackPanel>
        </Grid>
    </DataTemplate>


    <DataTemplate x:Key="EntitySetTemplate">
        <Grid>
            <TextBlock Text="{Binding }" />
        </Grid>
    </DataTemplate>
</ResourceDictionary>
